
<?php
header('Content-Type:application/json');
$code=array("status"=>false,"msg"=>"");
$mysqli = new mysqli('localhost', 'songsong', '123456', 'sids');
$mysqli->query('set names utf8');
del($mysqli, $code);
$mysqli->close();

function del(mysqli $mysqli, array $code){
    $sno = $_GET['sno'];
//    $sno = 18211;
    $query = "delete from student where sno={$sno}";
    $result = $mysqli->query($query);
    if ($result){
        $code['status'] = true;
        $code['msg'] = "del success";
    }else {
        $code['msg'] = "del false";
    	$code['status'] = false;
    }
    $ret = json_encode($code);
    echo $ret;
}
?>

